<#assign pojo=oneToManyPojo.getOne()>
<#assign many=oneToManyPojo.getMany()>
<#assign ones=oneToManyPojo.getOnes()>
package ${pojo.getPackageName()}.feign;

<#assign classbody>
<#assign service="${pojo.getDeclarationNameFirstLetterLower()}Service">
<#assign declarationName = pojo.importType(pojo.getDeclarationName())>
<#assign declarationNameFirstLetterLower = "${pojo.getDeclarationNameFirstLetterLower()}">
<#assign declarationComment = "${pojo.getComment()}">
/**
 * @author bo.wang
 */
public interface Base${declarationName}Service {

    @RequestMapping(value = "/", method = RequestMethod.GET)
    public List<${declarationName}VO> find${declarationName}ByList(@RequestParam Map params) throws Exception;

    /**
    * 分页列出${declarationComment}
    */
    @RequestMapping(value = "/findByPage", method = RequestMethod.GET)
    public DaoPage find${declarationName}ByPage(@RequestParam Map params) throws Exception ;

    /**
    * 新建一个${declarationComment}
    */
    @RequestMapping(value = "/", method = RequestMethod.POST)
    public ${declarationName}VO create(@RequestBody ${declarationName}VO ${declarationNameFirstLetterLower}VO) ;

    /**
    * 获取单个${declarationComment}
    */
    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    public ${declarationName}VO findById(@PathVariable("id") String id);

    /**
    * 更新某个指定的实体
    */
    @RequestMapping(value = "/{id}", method = RequestMethod.PUT)
    public ${declarationName}VO update(@PathVariable("id") String id, @RequestBody ${declarationName}VO ${declarationNameFirstLetterLower}VO) ;

    /**
    * 更新指定主键数据（提供部分信息）
    */
    @RequestMapping(value = "/{ids_}", method = RequestMethod.PATCH)
    public void updatePatch(@PathVariable("ids_") String ids_, @RequestBody Map ${declarationNameFirstLetterLower}VO);

    /**
    * 删除某个${declarationComment}
    */
    @RequestMapping(value = "/{ids_}", method = RequestMethod.DELETE)
    public void delete(@PathVariable("ids_") String ids_);

    /**
    * 保存带状态的Map数据集合
    */
    @RequestMapping(value = "/saveMap", method = RequestMethod.POST)
    public void saveMap(@RequestBody Map<String, List<${declarationName}VO>> dataListsMap);

    /**
    * 保存数据集合
    */
    @RequestMapping(value = "/saveAll", method = RequestMethod.POST)
    public void saveAll(@RequestBody List<${declarationName}VO> dataLists) ;

    <#foreach child in many>
        <#assign childdeclarationName = child.importType(child.getDeclarationName())>
        <#assign childdeclarationNameFirstLetterLower = child.importType(child.getDeclarationNameFirstLetterLower())>
        <#assign tempchild=child>

        <#if child.getRelation() == "MANY_EMBED">
    /**
    * 列出所有功能
    */
    @RequestMapping(value = "/${childdeclarationNameFirstLetterLower}", method = RequestMethod.GET)
    public List<${childdeclarationName}VO> find${childdeclarationName}ByList(@RequestParam Map params) throws Exception;

    /**
    * 分页列出功能
    @RequestMapping(value = "/${childdeclarationNameFirstLetterLower}/findByPage", method = RequestMethod.GET)
    public DaoPage find${childdeclarationName}ByPage(@RequestParam Map params) throws Exception;

    /**
    * 新建一个功能
    */
    @RequestMapping(value = "/${childdeclarationNameFirstLetterLower}/{${declarationNameFirstLetterLower}Id}", method = RequestMethod.POST)
    public ${childdeclarationName}VO create${childdeclarationName}(@PathVariable("{${declarationNameFirstLetterLower}Id}") String ${declarationNameFirstLetterLower}Id,@RequestBody ${childdeclarationName}VO ${child.getDeclarationNameFirstLetterLower()}VO) ;

    /**
    * 获取单个功能
    */
    @RequestMapping(value = "/${childdeclarationNameFirstLetterLower}/{${declarationNameFirstLetterLower}Id}/{id}", method = RequestMethod.GET)
    public ${childdeclarationName}VO find${childdeclarationName}ById(@PathVariable("{${declarationNameFirstLetterLower}Id}") String ${declarationNameFirstLetterLower}Id,@PathVariable("id") String id) ;

    /**
    * 更新某个指定的实体
    */
    @RequestMapping(value = "/${childdeclarationNameFirstLetterLower}/{${declarationNameFirstLetterLower}Id}/{id}", method = RequestMethod.PUT)
    public ${childdeclarationName}VO update${childdeclarationName}(@PathVariable("{${declarationNameFirstLetterLower}Id}") String ${declarationNameFirstLetterLower}Id, @PathVariable("id") String id, @RequestBody ${childdeclarationName}VO ${child.getDeclarationNameFirstLetterLower()}VO) ;

    /**
    * 更新指定主键数据（提供部分信息）
    */
    @RequestMapping(value = "/${childdeclarationNameFirstLetterLower}/{${declarationNameFirstLetterLower}Id}/{ids_}", method = RequestMethod.PATCH)
    public void update${childdeclarationName}Patch(@PathVariable("{${declarationNameFirstLetterLower}Id}") String ${declarationNameFirstLetterLower}Id, @PathVariable("ids_") String ids_,  @RequestBody Map ${child.getDeclarationNameFirstLetterLower()}VO) {;

    /**
    * 删除某个功能
    */
    @RequestMapping(value = "/${childdeclarationNameFirstLetterLower}/{${declarationNameFirstLetterLower}Id}/{ids_}", method = RequestMethod.DELETE)
    public void delete${childdeclarationName}(@PathVariable("{${declarationNameFirstLetterLower}Id}") String ${declarationNameFirstLetterLower}Id, @PathVariable("ids_") String ids_) ;
        </#if>
        <#if child.getRelation() == "MANY_DEFAULT">

    /**
    * 列出所有功能
    */
    @RequestMapping(value = "/${childdeclarationNameFirstLetterLower}/{${declarationNameFirstLetterLower}Id}", method = RequestMethod.GET)
    public List<${childdeclarationName}VO> find${childdeclarationName}ByList(@PathVariable("{${declarationNameFirstLetterLower}Id}") String ${declarationNameFirstLetterLower}Id,@RequestParam Map params) throws Exception ;

    /**
    * 分页列出功能
    */
    @RequestMapping(value = "/${childdeclarationNameFirstLetterLower}/{${declarationNameFirstLetterLower}Id}/findByPage", method = RequestMethod.GET)
    public DaoPage find${childdeclarationName}ByPage(@PathVariable("{${declarationNameFirstLetterLower}Id}") String ${declarationNameFirstLetterLower}Id,@RequestParam Map params) throws Exception ;

    /**
    * 新建一个功能
    */
    @RequestMapping(value = "/${childdeclarationNameFirstLetterLower}/{${declarationNameFirstLetterLower}Id}", method = RequestMethod.POST)
    public ${childdeclarationName}VO create${childdeclarationName}(@PathVariable("{${declarationNameFirstLetterLower}Id}") String ${declarationNameFirstLetterLower}Id, @RequestBody ${childdeclarationName}VO ${child.getDeclarationNameFirstLetterLower()}VO) ;

    /**
    * 获取单个功能
    */
    @RequestMapping(value = "/${childdeclarationNameFirstLetterLower}/{${declarationNameFirstLetterLower}Id}/{id}", method = RequestMethod.GET)
    public ${childdeclarationName}VO find${childdeclarationName}ById(@PathVariable("{${declarationNameFirstLetterLower}Id}") String ${declarationNameFirstLetterLower}Id, @PathVariable("id") String id) ;

    /**
    * 更新指定主键数据的全部信息
    */
    @RequestMapping(value = "/${childdeclarationNameFirstLetterLower}/{${declarationNameFirstLetterLower}Id}/{id}", method = RequestMethod.PUT)
    public ${childdeclarationName}VO update${childdeclarationName}(@PathVariable("{${declarationNameFirstLetterLower}Id}") String ${declarationNameFirstLetterLower}Id, @PathVariable("id") String id, @ApiParam(value = "更新的", required = true) @RequestBody ${childdeclarationName}VO ${child.getDeclarationNameFirstLetterLower()}VO) ;

    /**
    * 更新指定主键数据（提供部分信息）
    */
    @RequestMapping(value = "/${childdeclarationNameFirstLetterLower}/{${declarationNameFirstLetterLower}Id}/{ids_}", method = RequestMethod.PATCH)
    public void update${childdeclarationName}Patch(@PathVariable("{${declarationNameFirstLetterLower}Id}") String ${declarationNameFirstLetterLower}Id, @PathVariable("ids_") String ids_,  @RequestBody Map ${child.getDeclarationNameFirstLetterLower()}VO) ;

    /**
    * 删除某个功能
    */
    @RequestMapping(value = "/${childdeclarationNameFirstLetterLower}/{${declarationNameFirstLetterLower}Id}/{ids_}", method = RequestMethod.DELETE)
    public void delete${childdeclarationName}(@PathVariable("{${declarationNameFirstLetterLower}Id}") String ${declarationNameFirstLetterLower}Id, @PathVariable("ids_") String ids_) ;

    /**
    * 保存带状态的Map数据集合
    */
    @RequestMapping(value = "/${childdeclarationNameFirstLetterLower}/saveMap", method = RequestMethod.POST)
    public void saveMap(@RequestBody Map<String, List<${childdeclarationName}VO>> dataListsMap) ;

    /**
    * 保存数据集合
    */
    @RequestMapping(value = "/${childdeclarationNameFirstLetterLower}/saveAll", method = RequestMethod.POST)
    public void saveAll(@RequestBody List<${childdeclarationName}VO> dataLists) ;
        </#if>

    </#foreach>
    <#foreach child in ones>
    </#foreach>
}
</#assign>
import com.ling.pl.core.commons.support.DaoPage;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;
import ${pojo.getPackageName()}.model.${declarationName};
import ${pojo.getPackageName()}.model.${declarationName}VO;
import ${pojo.getPackageName()}.model.${declarationName};
<#foreach child in many>
    <#assign childdeclarationName = child.importType(child.getDeclarationName())>
import ${child.getPackageName()}.model.${childdeclarationName}VO;
import ${child.getPackageName()}.model.${childdeclarationName};
</#foreach>
<#foreach child in ones>
    <#assign childdeclarationName = child.importType(child.getDeclarationName())>
import ${child.getPackageName()}.model.${childdeclarationName}VO;
import ${child.getPackageName()}.model.${childdeclarationName};
</#foreach>
${classbody}
